//
//  attentionDoctorsModel.m
//  FastDoctor
//
//  Created by 云卷云舒丶 on 16/7/8.
//  Copyright © 2016年 sc. All rights reserved.
//

#import "attentionDoctorsModel.h"
#import "NetWorkTool.h"
@implementation attentionDoctorsModel


+ (instancetype)modelWithDict:(NSDictionary *)dict
{
    attentionDoctorsModel * model = [[attentionDoctorsModel alloc]init];
    
    [model setValuesForKeysWithDictionary:dict];
    
    return model;
}

+(void)focusListWithSuccess:(void (^)(NSArray<attentionDoctorsModel *> *))successBlock error:(void (^)())errorBlock{
    NSString *urlString = kMatchDoctors;
    NSDictionary *paramDic = @{@"ci1_id":@1,
                               @"ci2_id":@3,
                               @"ci3_id":@3,
                               @"diagnosis_type":@0,
                               @"page_size":@15,
                               @"is_confirmed":@1,
                               @"user_id":@1000089,
                               @"page":@1,
                               @"has_diagnosis":@2
                               };
    [[NetWorkTool sharedWorkTool]POST:urlString parameters:paramDic progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        
        NSMutableArray * mArray = [NSMutableArray array];
        NSArray * tempArray = responseObject[@"data"];
        
        [tempArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            attentionDoctorsModel * model = [attentionDoctorsModel modelWithDict:obj];
            [mArray addObject:model];
        }];
        if (successBlock) {
            successBlock(mArray.copy);
        }
        
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        if (errorBlock) {
            errorBlock();
        }
    }];
    
    

}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}

@end
